<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <el-input :value="val" @input="val=$event"></el-input>
        <el-input v-model="val"></el-input>
    </div>
    <script src="./node_modules/vue/dist/vue.js"></script>
    <script>
        Vue.component('el-input',{
            props:{
                value:{
                    type:String,
                    required:true 
                }
            },
            template:`
                <div>
                    <input :value="value" @input="$emit('input',$event.target.value)" />
                </div>
            `
        })
        var vm = new Vue({
            el:'#app',
            data:{
                val:'hello vue'
            },
            methods:{
                
            }
        })


   
    </script>
</body>
</html>
